package com.xixibaby.storage.oss;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;


/**
 * 暂时注销了message那一块的东西
 */
@Getter
@Setter
@Slf4j
@Configuration
@ConfigurationProperties(prefix = "spring.aliyun")
public class AliyunProperty implements InitializingBean {
    private String appid;
    private String appsecret;

    private OssProperties oss;
//    private MessageProperties message;


    @Override
    public void afterPropertiesSet() throws Exception {

//        if(this.message!=null) {
//            Map<String, SmsTemplate> templates =  this.message.getTemplates();
//            if(templates == null){
//                log.error("启用短信功能必须配置模板！spring.aliyun.message.templates!");
//            }
//            if( !templates.isEmpty()){
//                for (Map.Entry<String, SmsTemplate> templateEntry : templates.entrySet()) {
//                    log.info("加载短信模板[{}]....",templateEntry.getKey());
//                    SmsTemplate value = templateEntry.getValue();
//                    if(value.getSignName() == null){
//                        value.setSignName(message.getSignName());
//                    }
//                }
//            }
//        }
    }


}
